library(dplyr)
library(tidyverse)
library(plotly)
library(httr)
library(jsonlite)
data(nyc_inspections)
## Warning in data(nyc_inspections): data set 'nyc_inspections' not found
nyc_inspections_cleaned =
nyc_inspections |>
janitor::clean_names()|>
select(
boro, zipcode, inspection_date, dba, cuisine_description, score, grade,latitude, longitude) |>
rename(restaurant = dba)
nyc_inspections_cleaned |>
mutate(text_label = str_c("\nGrade:", grade, "\nrestaurant:", restaurant)) |>
plot_ly(
x = ~latitude, y = ~longitude, type = "scatter", mode = "markers",
color = ~grade, text = ~text_label, alpha = 0.5)
## Warning: Ignoring 262 observations